<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // getCurrentPosition(fn1,fn2)
    navigator.geolocation.getCurrentPosition(function(pos){
        console.log("A")
        console.log(pos)
    },function(err){
        console.log("B")
        console.log(err)
    })

    /*
    var i =0;
    function Foo(a,b){
        if (i==1){
            a('成功');
        } else {
            b('错误')
        }
    }

    Foo(function(s){
        alert(s);
    },function(s){
        console.log(s);
    })*/
</script>
</body>
</html>